#include <iostream>
#include <vector>
using namespace std;

int minArray(vector<int>& v,int num){
    int size=INT32_MAX;
    int left=0,right=0;
    int sum=0,result=0;
    while(right<v.size()){
        sum+=v[right];
        while(num<=sum){
            result=right-left+1;
            size=size<result?size:result;
            sum-=v[left++];
        }
        right++;
    }
    return size==INT32_MAX?0:result;
}

int main(){
    vector<int> v={2,3,1,2,4,3};
    int mins=minArray(v,7);
    cout<<mins<<endl;
    return 0;
}